/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class QuestionDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression idQuest;
	public final StringExpression question;
	
	public QuestionDetachedCriteria() {
		super(orm.Question.class, orm.QuestionCriteria.class);
		idQuest = new IntegerExpression("idQuest", this.getDetachedCriteria());
		question = new StringExpression("question", this.getDetachedCriteria());
	}
	
	public QuestionDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, orm.QuestionCriteria.class);
		idQuest = new IntegerExpression("idQuest", this.getDetachedCriteria());
		question = new StringExpression("question", this.getDetachedCriteria());
	}
	
	public QuestFormDetachedCriteria createQuestFormCriteria() {
		return new QuestFormDetachedCriteria(createCriteria("questForm"));
	}
	
	public ResponseDetachedCriteria createResponseCriteria() {
		return new ResponseDetachedCriteria(createCriteria("ORM_Response"));
	}
	
	public Question uniqueQuestion(PersistentSession session) {
		return (Question) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Question[] listQuestion(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Question[]) list.toArray(new Question[list.size()]);
	}
}

